﻿/// <reference path="../ext.js" />
Ext.define('WeCompany.model.Folder', {
    extend: 'Ext.data.Model',
    fields: ['text', 'id', 'parentId'],
    //验证项,目录名不能为空
    validations: [{
        type: 'presence',
        field:'text'
    }],
    proxy: {
        type: 'ajax',
        api: {
            create: 'Folder/Create',  //新增
            read: 'Folder/LoadAll',    //读取
            update: 'Folder/Update',  //修改
            destroy: 'Folder/Remove'  //删除
        },reader: {
            type: 'json',
            root: 'data',
            messageProperty:'Msg'
        },writer: {
            type: 'json',
            root: 'data',
            encode: true,
            allowSingle:true
        },listeners:{
            //exception:function()
        }
    }
});